#include<iostream>
#include<vector>
using namespace std;


class Test
{
public:
	Test(int a) { cout << "Test(int)" << endl; }
	Test(int a, int b) { cout << "Test(int,int)" << endl; }
	Test(const Test& a) { cout << "Test(const Test&)" << endl; }
	Test(const Test&& a) { cout << "Test(const Test&&)" << endl; }
	~Test() { cout << "~Test()" << endl; }
};
int main()
{
	/*Test t1(10);*/
	vector<Test>v;
	v.reserve(100);//只开辟空间，这些空间并没有进行初始化

	//cout << "=====================" << endl;
	////传左值---匹配的是拷贝构造函数
	//v.push_back(Test(20));
	//v.emplace_back(Test(20));
	//cout << "=====================" << endl;

	//cout << "=====================" << endl;
	////传右值---匹配的是移动构造函数
	//v.push_back(Test(20));
	//v.emplace_back(Test(20));
	//cout << "=====================" << endl;


	/*v.emplace_back(10);
	v.push_back(10);*/


	v.push_back({ 10,20 });
	//v.emplace_back({ 10,20 });//err
	return 0;
}
